<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="../../../../style.css" type="text/css" media="screen">
<link rel="stylesheet" href="../../../../print.css" type="text/css" media="print">
<meta content="EasingUtil,org.as3lib.kitchensync.easing.EasingUtil,call,generateArray,getAveragedFunction" name="keywords">
<title>org.as3lib.kitchensync.easing.EasingUtil</title>
</head>
<body>
<script type="text/javascript" language="javascript" src="../../../../asdoc.js"></script><script type="text/javascript" language="javascript" src="../../../../cookies.js"></script><script type="text/javascript" language="javascript">
<!--
				asdocTitle = 'EasingUtil - KitchenSync';
				var baseRef = '../../../../';
				window.onload = configPage;
			--></script>
<table style="display:none" id="titleTable" cellspacing="0" cellpadding="0" class="titleTable">
<tr>
<td align="left" class="titleTableTitle">API Documentation</td><td align="right" class="titleTableTopNav"><a onclick="loadClassListFrame('../../../../all-classes.html')" href="../../../../package-summary.html">All&nbsp;Packages</a>&nbsp;|&nbsp;<a onclick="loadClassListFrame('../../../../all-classes.html')" href="../../../../class-summary.html">All&nbsp;Classes</a>&nbsp;|&nbsp;<a onclick="loadClassListFrame('../../../../index-list.html')" href="../../../../all-index-A.html">Index</a>&nbsp;|&nbsp;<a href="../../../../index.html?org/as3lib/kitchensync/easing/EasingUtil.html&amp;org/as3lib/kitchensync/easing/class-list.html" id="framesLink1">Frames</a><a onclick="parent.location=document.location" href="" style="display:none" id="noFramesLink1">No&nbsp;Frames</a></td><td rowspan="3" align="right" class="titleTableLogo"><img alt="Adobe Logo" title="Adobe Logo" class="logoImage" src="../../../../images/logo.jpg"></td>
</tr>
<tr class="titleTableRow2">
<td align="left" id="subTitle" class="titleTableSubTitle">Class&nbsp;EasingUtil</td><td align="right" id="subNav" class="titleTableSubNav"><a href="#methodSummary">Methods</a></td>
</tr>
<tr class="titleTableRow3">
<td colspan="2">&nbsp;</td>
</tr>
</table>
<script type="text/javascript" language="javascript">
<!--
if (!isEclipse() || window.name != ECLIPSE_FRAME_NAME) {titleBar_setSubTitle("Class EasingUtil"); titleBar_setSubNav(false,false,false,false,false,false,true,false,false,false,false,false,false,false);}
--></script>
<div class="MainContent">
<table cellspacing="0" cellpadding="0" class="classHeaderTable">
<tr>
<td class="classHeaderTableLabel">Package</td><td><a onclick="javascript:loadClassListFrame('class-list.html')" href="package-detail.html">org.as3lib.kitchensync.easing</a></td>
</tr>
<tr>
<td class="classHeaderTableLabel">Class</td><td class="classSignature">public class EasingUtil</td>
</tr>
</table>
<p></p>
  A package of handy methods for working with Easing functions and classes.
  
  <p></p>
<br>
<hr>
</div>
<a name="methodSummary"></a>
<div class="summarySection">
<div class="summaryTableTitle">Public Methods</div>
<table id="summaryTableMethod" class="summaryTable " cellpadding="3" cellspacing="0">
<tr>
<th>&nbsp;</th><th colspan="2">Method</th><th class="summaryTableOwnerCol">Defined&nbsp;by</th>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#call()">call</a>(func:Function, timeElapsed:Number, duration:Number, mod1:Number, mod2:Number):Number</div>
<div class="summaryTableDescription">[static]
   Provides a way to call an easing function with code-hinting and type checking (sorta).</div>
</td><td class="summaryTableOwnerCol">EasingUtil</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#generateArray()">generateArray</a>(func:Function, steps:int, mod1:Number, mod2:Number):Array</div>
<div class="summaryTableDescription">[static]
   Uses one of the easing functions to generate an array of results for as many steps as are specified.</div>
</td><td class="summaryTableOwnerCol">EasingUtil</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#getAveragedFunction()">getAveragedFunction</a>(easingFunction1:Function, easingFunction2:Function):Function</div>
<div class="summaryTableDescription">[static]
   Creates a new easing function based on two other easing functions.</div>
</td><td class="summaryTableOwnerCol">EasingUtil</td>
</tr>
</table>
</div>
<script type="text/javascript" language="javascript">
<!--
showHideInherited();
--></script>
<div class="MainContent">
<a name="methodDetail"></a>
<div class="detailSectionHeader">Method detail</div>
<a name="call()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">call</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td>
</tr>
</table>
<div class="detailBody">
<code>public static function call(func:Function, timeElapsed:Number, duration:Number, mod1:Number, mod2:Number):Number</code><p>
   Provides a way to call an easing function with code-hinting and type checking (sorta).
      </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">func</span>:Function</code> &mdash; - The function to call - Must be an Easing function.
   </td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">timeElapsed</span>:Number</code> &mdash; - The time since the tween began in milliseconds or frames.
      </td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">duration</span>:Number</code> &mdash; - The duration of the tween, in milliseconds or frames.
      </td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">mod1</span>:Number</code> &mdash; - An optional modifier for the function. Used for tweens such as Back and Elastic.
      </td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">mod2</span>:Number</code> &mdash; - An optional modifier for the function. Used for tweens such as Elastic.
      </td>
</tr>
</table>
<p></p>
<span class="label">Returns</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20"></td><td><code>Number</code> &mdash; Number - the result of the easing function.
      </td>
</tr>
</table>
<br>
<span class="label">Throws</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20"></td><td><code></code> &mdash; - If the easing function is passed modifiers that it can't handle. (Don't use them unless they're handled by the function)
   </td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20"></td><td><code></code> &mdash; - You may get unexpected results if you use a function that isn't an easing function.
   
   </td>
</tr>
</table>
</div>
<a name="generateArray()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">generateArray</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public static function generateArray(func:Function, steps:int, mod1:Number, mod2:Number):Array</code><p>
   Uses one of the easing functions to generate an array of results for as many steps as are specified.
   If steps is 10, you will have an array with length 10.
   
   </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">func</span>:Function</code> &mdash; - The function to call - Must be an Easing function.
   </td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">steps</span>:int</code> &mdash; - The number of results desired for the array.
      </td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">mod1</span>:Number</code> &mdash; - An optional modifier for the function. Used for tweens such as Back and Elastic.
      </td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">mod2</span>:Number</code> &mdash; - An optional modifier for the function. Used for tweens such as Elastic.
   </td>
</tr>
</table>
<p></p>
<span class="label">Returns</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20"></td><td><code>Array</code> &mdash; Array - An array with the results from the easing function over 'steps' iterations.
   </td>
</tr>
</table>
<p>
<span class="label">See also</span>
</p>
<div class="seeAlso">
<a href="../easing/EasingUtil.html#call()" target="">call()</a>
</div>
</div>
<a name="getAveragedFunction()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">getAveragedFunction</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public static function getAveragedFunction(easingFunction1:Function, easingFunction2:Function):Function</code><p>
   Creates a new easing function based on two other easing functions.
   
   </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">easingFunction1</span>:Function</code> &mdash; One of the two easing functions that will be averaged by the new function.
   </td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">easingFunction2</span>:Function</code> &mdash; The second of the two easing functions that will be averaged by the new function.
      </td>
</tr>
</table>
<p></p>
<span class="label">Returns</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20"></td><td><code>Function</code> &mdash; A new easing function that produces values averaged from the two easing functions.
      </td>
</tr>
</table>
<br>
<span class="label">Example</span>
<br>Combine cubic in/out easing with a sine wave oscillator.
      <div class='listing'><pre>
       myTween.easingFunction = EasingUtil.getAveragedFunction(Cubic.easeInOut, Oscillate.sine); 
      </pre></div>
   
   <p></p>
</div>
<br>
<br>
<hr>
<br>
<p></p>
<center class="copyright"> 
</center>
</div>
</body>
</html>
<!-- -->
